{% extends 'base.html' %}
{% load static %}
{% load myfilter %}

{% block css_style %}
<link rel="stylesheet" href="{% static 'index.css' %}">
{% endblock %}

{% block title %}
test
{% endblock %}

{% block content%}
<body>
    <div>123</div>
    <div>your name :{{name}}</div>
    <ul>
        {% for item in array %}
        <li>
            {{item}} --- {{ forloop.counter0 }} --- {{ forloop.counter }}  --- {{ forloop.revcounter }} --- {{ forloop.revcounter0 }} 
            {% if forloop.first %}
            is first
            {% elif forloop.last %}
            is last
            {% endif %}
        </li>
            {% empty %}
            <li> is empty</li>
        {% endfor %}
    </ul>

    <a href="{% url 'index' 'anything' %}">go back</a>

    <br />
{% comment %} 给 add 加10 变为30 {% endcomment %}
    <label>add: </label>{{count|add:10}} <br />
    <label>date: </label>{{time|date:"Y-m-d H:i:s"}} <br />
    <label>cut-str: </label>{{cut_str|cut:"-"}} <br />
    <label>capfirst: </label>{{cut_str|capfirst}} <br />
    <label>default: </label>{{default|default:"空列表"}} <br />

    {% comment %} 使用自定义filter {% endcomment %}
    <label>custom: </label>{{count|test:10}} <br />
</body>
{% endblock %}